import request from '@/utils/request'
import { getTokenFromCookie } from "@/utils/auth";

// 获取token
export const getToken = () => {
    return request({
        url: '/getToken',
        method: 'get',
        params: {
            appKey: 'testApi',
            appSecurity: 'e4a56ea4abc593bb567c491e32f11715'
        }
    })
}

// 站点小时数据查询
export const getStationHourData = (data) => {
    return request({
        url: '/weather/data/meteorologicalDataOfStation/hourDataQuery',
        method: 'get',
        params: data
    })
}

// 国家站7天预报
export const getCountryStation7DayForecast = (data) => {
    return request({
        url: '/weather/data/nationalStationSevenDayForcast/getDataByStation',
        method: 'get',
        params: data
    })
}

// 预警信息
export const getWarningInfo = (data) => {
    return request({
        url: '/weather/data/warningInformation/getValidWarningData',
        method: 'get',
        params: data
    })
}

// 小时预报
export const getHourForest = (data) => {
    return request({
        url: '/weather/data/latticeData/forecastOfSingleElement',
        method: 'get',
        params: data
    })
}

// 逐时预报
export const getHourlyForest = (data) => {
    return request({
        url: '/weather/data/latticeData/getHourlyDataByLocation',
        method: 'get',
        params: data
    })
}